home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / cbibcode.arc / FNSPLIT.C < prev    next >
Encoding:
C/C++ Source or Header  |  1991-08-05  |  620 b   |  17 lines

  1. /* fnsplit.c, from page 357 of Turbo C Bible */
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4. main ()
  5. {
  6.    char pathname [MAXPATH], drive [MAXDRIVE], dir [MAXDIR],
  7.     filename [MAXFILE], ext [MAXEXT];
  8.                  /* Prompt user for a complete path name */
  9.    printf ("Enter complete path name to parse:\n");
  10.    gets (pathname);       /* Decompose complete path name and
  11.                         display result    */
  12.    fnsplit (pathname, drive, dir, filename, ext);
  13.    printf ("Drive         : %s\n", drive);
  14.    printf ("Directory path: %s\n", dir);
  15.    printf ("Filename      : %s\n", filename);
  16.    printf ("Extension     : %s\n", ext);
  17. }